#ifndef _CHUNKMGR_H_
#define _CHUNKMGR_H_

#include "../Common/AllTool.h"
#include "DiskMgr.h"

enum CHUNK_STATE
{
	CKS_CONNECTED	= 0	,
	CKS_REPORT_IP		,
	CKS_REPORT_DATA		,
	CKS_OK				,
	CKS_DEAD	
};


struct CHUNK_INFO
{
	YYNet		Net;
	tstring		tsIp;
	int			iPort;
	int			iCount;
	CHUNK_STATE	State;
};

int StartChunkMgr();
int StopChunkMgr();
int BroadCommandToChunk(COMMAND &cmd);
int AllocFileBlock(size_t &i);
int GetChunkInfo(tstring &tsRet);
#endif